package com.jinlia.show.modules.base.wxapp.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.jinlia.show.modules.base.config.DynamicSchemaConfig;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 关注的商品
 */
@Data
@TableName(value = "wxapp_favourite_goods", schema = DynamicSchemaConfig.schema_wxapp)
public class FavouriteGoods {
    @TableId
    private Long id;
    /**
     * 收藏人id
     */
    private Long userId;

    /**
     * 收藏的商品
     */
    private Long goodsId;

    /**
     * 收藏时间
     */
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    private LocalDateTime createTime;
}
